package server.business;

import java.util.Date;

import server.ServerTransportProxy;
import server.commonData.Information;

public class InformationData 
{
	private int id;
	private int areaId;
	private String message;
	private String status;
	private int interval;
	private Date createdDate;
	private int createrId;
	private Date closeDate;
	private long nextNoticeTime;
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public int getInterval() {
		return interval;
	}
	public void setInterval(int interval) {
		this.interval = interval;
	}
	public Date getCreatedDate() {
		return createdDate;
	}
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	public Date getCloseDate() {
		return closeDate;
	}
	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}
	public long getNextNoticeTime() {
		return nextNoticeTime;
	}
	public void setNextNoticeTime(long nextNoticeTime) {
		this.nextNoticeTime = nextNoticeTime;
	}
	public int getAreaId() {
		return areaId;
	}
	public void setAreaId(int areaId) {
		this.areaId = areaId;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getCreaterId() {
		return createrId;
	}
	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}
	
	public void send()
	{
		this.nextNoticeTime = System.currentTimeMillis()+this.interval;
		Information infor = Information.newInformation(2);
		infor.pushPar(this.message);
		ServerTransportProxy.sendToAll(infor.toMessage());
	}
}
